package me.myqaq.myqaqcraft.slimefunaddon.tow;

import me.myqaq.myqaqcraft.slimefunaddon.MyQaqCraft;
import me.myqaq.myqaqcraft.slimefunaddon.utils.CU;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;
public class PlayerJoin implements Listener{

    // 标识这是一个侦听器
    @EventHandler
    public boolean onPlayJoin(PlayerJoinEvent event){
        // 侦听到玩家加入 执行
        Player player =event.getPlayer();
        FileConfiguration config = MyQaqCraft.getInstance().getConfig();
        event.setJoinMessage(CU.t(config.getString("join-message")+player.getName()));
        player.sendMessage(CU.t("&4你好！"));
        return true;
    }

}

